package cc.magicjson.spring.exploration;

import cc.magicjson.spring.exploration.service.DemoService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication // 标记这是一个Spring Boot应用
public class RoleAnnotationExplorationDemoApplication {

    public static void main(String[] args) {
        // 启动Spring应用并获取应用上下文
        ApplicationContext context = SpringApplication.run(RoleAnnotationExplorationDemoApplication.class, args);
        
        // 从上下文中获取DemoService的实例
        DemoService demoService = context.getBean(DemoService.class);
        // 调用DemoService的方法并打印结果
        System.out.println(demoService.doSomething());
    }
}
